package com.lp.board.controller;

import com.lp.board.service.IBoardService;
import com.lp.model.config.AppResult;
import com.lp.model.entity.board.Board;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/board")
public class BoardController {

    @Autowired
    private IBoardService boardService;

    /**
     * 获取所有板块
     */
    @GetMapping("/list")
    public AppResult getAll() {
        List<Board> boardList = boardService.getBoardList();
        return AppResult.success(boardList);
    }


}
